<script setup lang="ts">
import { ref, reactive } from 'vue'
import { getPolicy } from '@/api/user'
import { Toast } from 'vant'

const state = reactive({
    htmlText: ''
})

// 返回
const onClickLeft = () => history.back()

const getPolicyChange = async () => {
    const res: any = await getPolicy({
        id: 17
    })

    if (res) {
        state.htmlText = res.records[0].content
    } else {
        Toast(res.msg)
    }
}
getPolicyChange()

</script>

<template>
    <van-nav-bar title="服务协议" left-text="" left-arrow @click-left="onClickLeft" />
    <div class="text-agree" v-html="state.htmlText">
    </div>
</template>

<style scoped>
.text-agree{
    padding: 0.5rem 0.7rem;
}
</style>